package com.tiance.demo.service.mysql.bo.pageindex;

import com.tiance.demo.service.mysql.utils.ByteUtils;

import java.util.ArrayList;
import java.util.List;

public class UserRecord {

    /**
     * 总字节数
     */
    private int size;

    /**
     * 记录条数
     */
    private int sum;

    private byte[] bytes;

    /**
     * 记录的列表
     */
    private List<RowRecord> rowRecords = new ArrayList<>();

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    public byte[] getBytes() {
        return bytes;
    }

    public void setBytes(byte[] bytes) {
        this.bytes = bytes;
    }

    public List<RowRecord> getRowRecords() {
        return rowRecords;
    }

    public void setRowRecords(List<RowRecord> rowRecords) {
        this.rowRecords = rowRecords;
    }

    public void addRowRecord(RowRecord rowRecord) {
        this.rowRecords.add(rowRecord);
    }

    @Override
    public String toString() {
        return "UserRecord:\n" +
                "bytes=" + ByteUtils.bytes2HexStr(bytes) +
                ' ';
    }
}
